package ${package}.entity.${moduleName};

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Version
import lombok.Data;
import org.hibernate.annotations.UpdateTimestamp;

/**
 * ${functionName}.
 *
 *  @author ${author}
 *  @since ${datetime}
 */
@Data
@Entity
@Table(name = "${tableName}")
public class ${ClassName}  {

<#list fieldList as field>
	<#if field.fieldComment!?length gt 0>
		/**
		* ${field.fieldComment}.
		*/
	</#if>
	<#if field.primaryPk>
	@Id
	@GeneratedValue(
			strategy = GenerationType.IDENTITY
	)
	private ${field.attrType} ${field.attrName};
	<#else>
		<#if field.attrType == 'Date'>
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "${field.fieldName}", nullable = false,
			columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
	private ${field.attrType} ${field.attrName};
		<#else>
			<#if field.attrType == 'Integer' && field.fieldName == 'version'>
	@Version
	private Integer version = 1;
			<#else>
	@Column(name = "${field.fieldName}")
	private ${field.attrType} ${field.attrName};
			</#if>

		</#if>
  </#if>

</#list>

}